// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'Id',
        footer: "Foots",
        cnName: '生产退料',
        name: 'productionmaterials',
        url: "/productionmaterials/",
        sortName: "Id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {
      "MateCode": "",
      "MateName": "",
      "MateType": "",
      "ProductionOrder": "",
      "Workstation": "",
      "MateTime": "",
      "Documents": "",
      "Remark": "",
      "AutoGenerate": true
    };
    const editFormOptions = [
      [
        {
          "title": "退料单编号",
          "field": "MateCode",
          "type": "text",
          "required": true,
          "colSize": 8,
          "width": 500,
          "maxlength": 20
        },
        {
          "title": "",
          "field": "AutoGenerate",
          "type": "switch",
          "value": true,
          "colSize": 4,
          "onChange": (val, option) => {
            if (val) {
              option.data.MateCode = 'PC' + Math.floor(Math.random() * 9000 + 1000);
            }
          },
          "extra": {
            "style": "margin-left: 5px;display: inline-flex;align-items: center;"
          }
        }
      ],
      [
        {"title": "退料单名称", "field": "MateName", "type": "text", "required": true, "colSize": 12, "maxlength": 100}
      ],
      [
        {"title": "退料类型", "field": "MateType", "type": "text", "required": true, "colSize": 12}
      ],
      [
        {"title": "生产工单", "field": "ProductionOrder", "type": "text", "required": true, "colSize": 12}
      ],
      [
        {"title": "工作站", "field": "Workstation", "type": "text", "required": true, "colSize": 12}
      ],
      [
        {"title": "退料日期", "field": "MateTime", "type": "datetime", "required": true, "colSize": 12}
      ],
      [
        {"title": "单据状态", "field": "Documents", "type": "number", "required": true, "colSize": 12}
      ],
      [
        {"title": "备注", "field": "Remark", "type": "textarea", "colSize": 12, "maxlength": 200}
      ]
    ];
    const searchFormFields = {};
    const searchFormOptions = [];
    const columns = [{field:'Id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'MateCode',title:'退料单编号',type:'string',width:110,align:'left'},
                       {field:'MateName',title:'退料单名称',type:'string',width:110,align:'left'},
                       {field:'MateType',title:'退料类型',type:'string',width:110,align:'left'},
                       {field:'ProductionOrder',title:'生产工单',type:'string',width:110,align:'left'},
                       {field:'Workstation',title:'工作站',type:'string',width:110,align:'left'},
                       {field:'MateTime',title:'退料日期',type:'datetime',width:150,align:'left'},
                       {field:'Documents',title:'单据状态',type:'int',width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:110,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}